package com.yc.boot.train.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yc.boot.train.entity.Notice;
import com.yc.boot.train.model.find.GradeManage;
import com.yc.boot.train.model.find.NoticeMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Create with IntelliT IDEA
 *
 * @Author: zhengmingzhe
 * @Date: 2022/01/11/13:49
 * @Description:
 */
@Mapper
public interface NoticeMapper extends BaseMapper<NoticeMessage> {
    @Select("select n.id as id,n.notice_name as noticeName,n.notice_intro as noticeIntro,n.notice_content as noticeContent,"
    +"n.release_time as releaseTime,u.user_name as createPerson from notice_message as n"
    +" left join sys_user as u on n.create_by=u.id ${ew.customSqlSegment}")
    IPage<NoticeMessage> queryNoticeMessage(Page<NoticeMessage> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<NoticeMessage> wrapper);
}
